/*
 * SonarQube
 * Copyright (C) 2009-2017 SonarSource SA
 * mailto:info AT sonarsource DOT com
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 3 of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */
@import (reference) "../../variables";
@import (reference) "../../mixins";
@import (reference) "config";


.navigator { }


.navigator-element() {
  position: fixed;
  z-index: @navigator-element-z-index;
  box-sizing: border-box;
}

.navigator-header {
  height: @navigatorHeaderHeight;
  margin: @navigatorPadding;
  border: 1px solid @navigatorBorderLightColor;
  box-sizing: border-box;
}

.navigator-filters {
  position: relative;
  border: 1px solid @navigatorBorderLightColor;
  box-sizing: border-box;
}

.navigator-content {
  display: table;
  width: 100%;
}

.navigator-side {
  position: relative;
  display: table-cell;
  vertical-align: top;
  width: @navigatorResultsWidth + 2 * @navigatorPadding;
  min-width: 275px + 2 * @navigatorPadding;
  max-width: 600px + 2 * @navigatorPadding;
}

.navigator-main {
  display: table-cell;
  vertical-align: top;
}

.navigator-results {
  position: relative;
  z-index: @navigator-results-z-index;
  width: @navigatorResultsWidth;
  min-width: 275px;
  max-width: 600px;
  margin: @navigatorPadding @navigatorPadding 0;
  box-sizing: border-box;
}

.navigator-actions {
  position: relative;
  z-index: @navigator-actions-z-index;
  margin: 0 @navigatorPadding @navigatorPadding;
  border: 1px solid @navigatorBorderLightColor;
  box-sizing: border-box;
  .clearfix;
}

.navigator-details {
  position: relative;
  margin: @navigatorPadding 0 0 0;
}

.navigator-notes {
  display: none;
}

.navigator-with-notes {

  .navigator-notes {
    display: block;
  }
}


.measures-page {
  .navigator-details { overflow: visible; }
}


.navigator-fetching {
  &:before {
    content: " ";
    position: absolute;
    z-index: @navigator-fetching-z-index;
    top: 0; bottom: 0; left: 0; right: 0;
    background: #fff url(../../../images/loading.gif) no-repeat 4px 4px;
  }
}


.navigator-page-loader {
  padding: @navigatorPadding 0 0 @navigatorPadding;
}



// Header
.navigator-header {
  padding: 0 @navigatorPadding;
  background-color: @navigatorBarBackground;
  font-size: 0;

  .page-title,
  .page-actions {
    margin: (@navigatorHeaderHeight - @formControlHeight) / 2 0;
  }
}

.navigator-header-favorite {
  padding-left: 58px;
}

.navigator-header-title {
  display: inline-block;
  vertical-align: middle;
  color: @navigatorHeaderColor;
  font-size: 20px;
  line-height: @navigatorHeaderLineHeight;
}

.navigator-header-title-note {
  vertical-align: middle;
  color: #777;
  font-size: @smallFontSize;
}

.navigator-header-description {
  display: inline-block;
  vertical-align: middle;
  max-width: 70%;
  margin-left: 16px;
  font-size: @smallFontSize;
  font-style: italic;
}

.navigator-header-actions {
  margin: 8px 0 8px 20px;

  & > a {
    vertical-align: middle;
    margin: 0 8px;
    font-size: @smallFontSize;
  }
}

.navigator-header-menu-toggle {
  display: inline-block;
  vertical-align: top;
  height: 36px;
  margin-right: 10px;
  margin-left: -10px;
  padding: 10px;
  border-right: 1px solid transparent;
  box-sizing: border-box;
  cursor: pointer;
  transition: all 0.2s ease;

  &:hover {
    background-color: @navigatorHover;
  }

  &.active {
    border-color: #cdcdcd;
    background-color: #fff;
  }

  [class^="icon-"], [class*=" icon-"] {
    font-size: 16px;
  }
}



// Notes
.navigator-notes {
  margin: 0 @navigatorPadding @navigatorPadding @navigatorPadding;
  padding: 0 @navigatorPadding;
  border: 1px solid @navigatorBorderColor;
  background-color: @navigatorBarBackground;

  color: #777;
  font-size: @smallFontSize;
  line-height: @navigatorNotesHeight;
}



// Facets
.navigator-facets {
  padding: @navigatorPadding;
  border-bottom: 1px solid @navigatorBorderColor;
  background-color: @navigatorBarBackground;
}

.navigator-facets-list {

}

.navigator-facets-list-item {
  font-size: 0;
  margin-bottom: -6px;
}

.navigator-facets-list-item + .navigator-facets-list-item {
  margin-top: @navigatorPadding;
}

.navigator-facets-list-item-name {
  float: left;
  line-height: 22px;
  min-width: 120px;
  margin-right: @navigatorPadding;
  font-size: @smallFontSize;
  font-weight: normal;
  text-transform: uppercase;
}

.navigator-facets-list-item-options {
  overflow: hidden;
}



// Results
.navigator-results {
  background-color: @white;
  overflow-x: hidden;
  overflow-y: auto;

  &.fetching {
    .navigator-results-list { visibility: hidden; }
    .navigator-results-loader { display: block; }
  }
}

.navigator-results-loader {
  position: fixed;
  z-index: @navigator-results-loader-z-index;
  display: none;
  background-color: #fff;
}

.navigator-results-list {

  & > li {
    position: relative;
    z-index: @normal-z-index;
    padding: @navigatorPadding / 2 0;
    border: 1px solid;
    border-color: @navigatorBorderLightColor transparent;
    cursor: pointer;
    transition: all 0.2s ease;

    .line {
      padding: @navigatorPadding / 2 @navigatorPadding;
      line-height: 1.2;
    }

    .line-small {
      font-size: 11px;
      line-height: 14px;
    }

    .line-right {
      float: right;
    }

    .line-nowrap {
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    &:hover {
      background-color: @navigatorBarBackground;
    }

    &.active {
      z-index: @above-normal-z-index;
      background-color: #CAE3F2;
      border-color: #4B9FD5;
    }
  }

  & > li + li { margin-top: -1px; }
}

.navigator-results-no-results {
  padding-top: 20% !important;
  background: #fff !important;
  border-color: transparent !important;
  color: #999;
  cursor: default !important;
  text-align: center;
}



// Details
.navigator-details {
  background-color: @white;
  overflow: auto;

  &.loading {
    background: @white url("../../../images/loading.gif") no-repeat 4px 2px;
  }
}



// Status
.navigator-actions {
  padding: 0 @navigatorPadding 0 0;

  border-right: 1px solid @navigatorBorderLightColor;
  border-bottom: 1px solid @navigatorBorderLightColor;
  background-color: @navigatorBarBackground;
  font-size: @smallFontSize;

  strong { font-weight: bold; }
}

.navigator-actions-order {
  float: left;
  padding: 0 @navigatorPadding;
  line-height: @navigatorStatusHeight;
  cursor: pointer;
  transition: all 0.2s ease;

  &:hover {
    background-color: @navigatorHover;
  }
}

.navigator-actions-order-choices {
  position: absolute;
  top: 100%;
  left: -1px;
  min-width: @navigatorResultsWidth / 2;
  background-color: #fff;
  border: 1px solid @navigatorBorderLightColor;
  box-shadow: @defaultShadow;
  overflow: hidden;
  display: none;

  & > li {
    height: @navigatorStatusHeight;
    line-height: @navigatorStatusHeight;
    padding: 0 10px;
    cursor: pointer;
    transition: all 0.2s ease;

    &:hover {
      background-color: @navigatorBarBackground;
    }
  }

  &.open {
    display: block;
  }
}

.navigator-actions-total {
  float: right;
  height: @navigatorStatusHeight;
  line-height: @navigatorStatusHeight;
}

.navigator-actions-bulk {
  position: relative;
  top: -1px;
  margin-left: 8px;
  font-size: 16px;
  text-decoration: none;
}



// Footer
.navigator-page #footer {
  margin: 0;
  border-top: 1px solid @navigatorBorderLightColor;
}

.navigator-page #ftlinks {
  margin-top: 0;
}
